package com.example.demo.commons.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author root
 * @date 2021-01-25 14:17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo<T> {

    private Integer code;

    private T data;

    private String msg;


    public static <T> ResultVo<T> success() {
        return new ResultVo<T>(0, null, null);
    }

    public static <T> ResultVo<T> success(T data) {
        return new ResultVo<T>(0, data, "success");
    }
}
